package com.example.springbootpay.factory;

import com.example.springbootpay.service.PaymentService;
import com.example.springbootpay.service.impl.*;

public class PaymentFactory {
    public static PaymentService createPayment(String channel) {
        switch (channel.toLowerCase()) {
            case "alipay":
                return new AlipayPayment();
            case "wechat":
                return new WechatPayment();
            case "quickpass":
                return new QuickPassPayment();
            default:
                throw new IllegalArgumentException("不支持的支付渠道");
        }
    }
}